Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(from(X)) → MARK(X)
MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(from(X)) → A__FROM(mark(X))
MARK(s(X)) → MARK(X)
MARK(after(X1, X2)) → MARK(X1)
A__AFTER(0, XS) → MARK(XS)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
MARK(after(X1, X2)) → MARK(X2)
A__FROM(X) → MARK(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(from(X)) → MARK(X)
MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(from(X)) → A__FROM(mark(X))
MARK(s(X)) → MARK(X)
MARK(after(X1, X2)) → MARK(X1)
A__AFTER(0, XS) → MARK(XS)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
MARK(after(X1, X2)) → MARK(X2)
A__FROM(X) → MARK(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


A__AFTER(0, XS) → MARK(XS)
The remaining pairs can at least be oriented weakly.

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(from(X)) → MARK(X)
MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(from(X)) → A__FROM(mark(X))
MARK(s(X)) → MARK(X)
MARK(after(X1, X2)) → MARK(X1)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
MARK(after(X1, X2)) → MARK(X2)
A__FROM(X) → MARK(X)
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 1   
POL(A__AFTER(x1, x2)) = x1 + x2   
POL(A__FROM(x1)) = x1   
POL(MARK(x1)) = x1   
POL(a__after(x1, x2)) = x1 + x2   
POL(a__from(x1)) = x1   
POL(after(x1, x2)) = x1 + x2   
POL(cons(x1, x2)) = max(x1, x2)   
POL(from(x1)) = x1   
POL(mark(x1)) = x1   
POL(s(x1)) = x1   

The following usable rules [17] were oriented:

a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
a__after(0, XS) → mark(XS)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(from(X)) → a__from(mark(X))
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → cons(mark(X), from(s(X)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
QDP
          ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(from(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(s(X)) → MARK(X)
MARK(after(X1, X2)) → MARK(X1)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
MARK(after(X1, X2)) → MARK(X2)
A__FROM(X) → MARK(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(from(X)) → MARK(X)
A__FROM(X) → MARK(X)
The remaining pairs can at least be oriented weakly.

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(from(X)) → A__FROM(mark(X))
MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(s(X)) → MARK(X)
MARK(after(X1, X2)) → MARK(X1)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
MARK(after(X1, X2)) → MARK(X2)
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 1   
POL(A__AFTER(x1, x2)) = x1 + x2   
POL(A__FROM(x1)) = 1 + x1   
POL(MARK(x1)) = x1   
POL(a__after(x1, x2)) = x1 + x2   
POL(a__from(x1)) = 1 + x1   
POL(after(x1, x2)) = x1 + x2   
POL(cons(x1, x2)) = max(x1, x2)   
POL(from(x1)) = 1 + x1   
POL(mark(x1)) = x1   
POL(s(x1)) = x1   

The following usable rules [17] were oriented:

a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
a__after(0, XS) → mark(XS)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(from(X)) → a__from(mark(X))
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → cons(mark(X), from(s(X)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
        ↳ QDP
          ↳ QDPOrderProof
QDP
              ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(from(X)) → A__FROM(mark(X))
MARK(s(X)) → MARK(X)
MARK(after(X1, X2)) → MARK(X1)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
MARK(after(X1, X2)) → MARK(X2)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
QDP
                  ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(s(X)) → MARK(X)
MARK(after(X1, X2)) → MARK(X1)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
MARK(after(X1, X2)) → MARK(X2)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(after(X1, X2)) → A__AFTER(mark(X1), mark(X2))
MARK(after(X1, X2)) → MARK(X1)
MARK(after(X1, X2)) → MARK(X2)
The remaining pairs can at least be oriented weakly.

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → MARK(XS)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 0   
POL(A__AFTER(x1, x2)) = x1 + x2   
POL(MARK(x1)) = x1   
POL(a__after(x1, x2)) = 1 + x1 + x2   
POL(a__from(x1)) = x1   
POL(after(x1, x2)) = 1 + x1 + x2   
POL(cons(x1, x2)) = max(x1, x2)   
POL(from(x1)) = x1   
POL(mark(x1)) = x1   
POL(s(x1)) = x1   

The following usable rules [17] were oriented:

a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
a__after(0, XS) → mark(XS)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(from(X)) → a__from(mark(X))
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → cons(mark(X), from(s(X)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ QDP
                  ↳ QDPOrderProof
QDP
                      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

A__AFTER(s(N), cons(X, XS)) → MARK(N)
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
A__AFTER(s(N), cons(X, XS)) → MARK(XS)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 2 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ DependencyGraphProof
                        ↳ AND
QDP
                            ↳ UsableRulesProof
                          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ DependencyGraphProof
                        ↳ AND
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QDPSizeChangeProof
                          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ DependencyGraphProof
                        ↳ AND
                          ↳ QDP
QDP
                            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


A__AFTER(s(N), cons(X, XS)) → A__AFTER(mark(N), mark(XS))
The remaining pairs can at least be oriented weakly.
none
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(A__AFTER(x1, x2)) = x1   
POL(a__after(x1, x2)) = x2   
POL(a__from(x1)) = 0   
POL(after(x1, x2)) = x2   
POL(cons(x1, x2)) = x2   
POL(from(x1)) = 0   
POL(mark(x1)) = x1   
POL(s(x1)) = 1 + x1   

The following usable rules [17] were oriented:

a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
a__after(0, XS) → mark(XS)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(from(X)) → a__from(mark(X))
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → cons(mark(X), from(s(X)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ QDPOrderProof
        ↳ QDP
          ↳ QDPOrderProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ QDP
                  ↳ QDPOrderProof
                    ↳ QDP
                      ↳ DependencyGraphProof
                        ↳ AND
                          ↳ QDP
                          ↳ QDP
                            ↳ QDPOrderProof
QDP
                                ↳ PisEmptyProof

Q DP problem:
P is empty.
The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__after(0, XS) → mark(XS)
a__after(s(N), cons(X, XS)) → a__after(mark(N), mark(XS))
mark(from(X)) → a__from(mark(X))
mark(after(X1, X2)) → a__after(mark(X1), mark(X2))
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(0) → 0
a__from(X) → from(X)
a__after(X1, X2) → after(X1, X2)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.